home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1997 May / EnigmA AMIGA RUN 18 (1997)(G.R. Edizioni)(IT)[!][issue 1997-05][EAR-CD II].iso / earcd / misc / emu / arosdev.lha / AROS / rom / utility / intfindnamedobj.c < prev    next >
C/C++ Source or Header  |  1997-02-07  |  1KB  |  51 lines

  1. /*
  2.     (C) 1995-97 AROS - The Amiga Replacement OS
  3.     $Id: intfindnamedobj.c,v 1.4 1997/02/06 15:25:04 ldp Exp $
  4.  
  5.     Desc:
  6.     Lang: english
  7. */
  8.  
  9. /*
  10.     This function will start searching through a sublist of NamedObjects
  11.     looking for the node which has the correct name (case insensitive).
  12.     Case sensitive searches are done with FindName().
  13.  
  14.     The reason for the Utility_ prefixing the call is so that I can
  15.     use a define IntFindNamedObj() that handles UtilityBase.
  16. */
  17.  
  18. #include "utility_intern.h"
  19. #include <proto/exec.h>
  20. #include <proto/utility.h>
  21.  
  22. struct IntNamedObject *
  23. IntFindNamedObj(struct NameSpace *ns,
  24.         struct Node *start,
  25.         STRPTR name,
  26.         struct UtilityBase *UtilityBase)
  27. {
  28.     struct IntNamedObject *no = NULL;
  29.  
  30.     if((ns->ns_Flags & NSF_CASE))
  31.     {
  32.     no = (struct IntNamedObject *)
  33.         FindName((struct List *)start->ln_Pred, name);
  34.     }
  35.     else
  36.     {
  37.     /* We are at the end of the list when ln_Succ == NULL */
  38.     while(start->ln_Succ != NULL)
  39.     {
  40.         if(!Stricmp(name, start->ln_Name))
  41.         {
  42.         /* We have found the node we are after. */
  43.         return GetIntNamedObject(start);
  44.         }
  45.         start = start->ln_Succ;
  46.     }
  47.     }
  48.  
  49.     return NULL;
  50. }
  51.